The present invention relates to an information processing apparatus having a mask function, and particularly to an information processing apparatus having a mask function for masking an undesired bit or bits from among a plurality of bits read out of a memory.
An information processing apparatus, in general, manipulates a plurality of bits altogether as the unit of processing which is defined as a byte or a word. For example, an 8-bit processor accesses a memory byte by byte, i.e., 8 bits, by 8 bits, using an 8-bit data bus. In a 16-bit processor, 16 bits (two bytes=one word) are simultaneously manipulated.
However, there is a case that only a part of bits of a byte or a word are required in order to execute a desired instruction. In this case, the bit or bits to be processed must be selected from among a plurality of bits. Heretofore, this was done by a bit-shift operation. However, the bit-shift operation requires a long period of time because the non-selected bit or bits also have to be shifted bit by bit. On the other hand, a mask operation has been proposed to select a part of the bits constituting a word or a byte. In the mask operation, non-selected bit or bits are masked by using a mask signal, and only a desired bit or bits are allowed to be taken out as valid bits. However, the mask operation of the prior art has produced the mask signal by combining multiple arithmetic instructions, so that complex processing and control are necessary. For instance, in order to detect the position of a bit to be masked, a complex arithmetic calculation is required and thus, when multiple bits are to be masked, the mask operation of the prior art requires a long period of time.